package org.iks.common.constant;

/**
 * @author kzou
 * @date 2023/12/17 19:48
 * @description: 排序方式
 */
public enum SortType {
    DESC("desc"),
    ASC("asc"),;

    private final String type;
    SortType(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public static SortType parse(String type) {
        SortType[] values = SortType.values();
        for (SortType value : values) {
            if (value.type.equals(type.toLowerCase())) {
                return value;
            }
        }
        return null;
    }

}
